<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>

<!DOCTYPE html>
<html>
  <head>
    <base href="<%=basePath%>">
    
    <title>登陆</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<meta http-equiv="expires" content="0">    
	<meta http-equiv="keywords" content="keyword1,keyword2,keyword3">
	<meta http-equiv="description" content="This is my page">
	
	<link rel="stylesheet" type="text/css"	href="${pageContext.request.contextPath}/js/easyui/demo.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/default/easyui.css">
	<link rel="stylesheet" type="text/css" href="${pageContext.request.contextPath}/js/easyui/themes/icon.css">
	<script type="text/javascript"	src="${pageContext.request.contextPath}/js/jquery-1.11.0.min.js"></script>
	<script type="text/javascript" src="${pageContext.request.contextPath}/js/easyui/jquery.easyui.min.js"></script>
  	<script type="text/javascript">
  		function sub() {
  			$("#loginform").submit();
		}
  		function randomcode_refresh(){
            //1:获取这个img的元素
            var img = document.getElementById("randomcode_img");
            //欺骗浏览器,地址还是这个地址，但参数一定要变化
            var date = new Date();
            img.src="${pageContext.request.contextPath}/authCode.do?"+date.getTime();//时间毫秒值
		}
  	</script>
  </head>
  
  <body>
  	<form action="${pageContext.request.contextPath}/login.do" id="loginform" method="post">
		<div class="easyui-panel" title="LOGIN" style="width:400px;padding:30px 60px">
			<div style="margin-bottom:20px">
				<div>name:</div>
				<input class="easyui-textbox" id="username" name="username" style="width:100%;height:32px">
			</div>
			<div style="margin-bottom:20px">
				<div>password:</div>
				<input class="easyui-textbox" id="password" name="password" style="width:100%;height:32px">
			</div>
			<div style="margin-bottom:20px">
				<div>验证码:</div>
				<input id="randomcode" name="randomcode" size="8" style="width:50%;height:32px" /> 
				<img id="randomcode_img" src="${pageContext.request.contextPath}/authCode.do" alt=""
								width="56" height="20" align='absMiddle' /> 
				<a href=javascript:randomcode_refresh()>刷新</a>
			</div>
			<div style="margin-bottom:20px">
				<div></div>
				<input type="checkbox" name="rememberMe" />自动登陆
			</div>
			<div>
				<a onclick="sub()" class="easyui-linkbutton" iconCls="icon-ok" style="width:100%;height:32px">LOGIN</a>
			</div>
		</div>
	</form>
  </body>
</html>
